package com.tudouji.project.mt.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.mt.mapper.MtSalesItemsMapper;
import com.tudouji.project.mt.domain.MtSalesItems;
import com.tudouji.project.mt.service.IMtSalesItemsService;

/**
 * 美团门店菜品销售明细Service业务层处理
 * 
 * @author tudouji
 * @date 2023-12-04
 */
@Service
public class MtSalesItemsServiceImpl implements IMtSalesItemsService 
{
    @Autowired
    private MtSalesItemsMapper mtSalesItemsMapper;

    /**
     * 查询美团门店菜品销售明细
     * 
     * @param id 美团门店菜品销售明细ID
     * @return 美团门店菜品销售明细
     */
    @Override
    public MtSalesItems selectMtSalesItemsById(Long id)
    {
        return mtSalesItemsMapper.selectMtSalesItemsById(id);
    }

    /**
     * 查询美团门店菜品销售明细列表
     * 
     * @param mtSalesItems 美团门店菜品销售明细
     * @return 美团门店菜品销售明细
     */
    @Override
    public List<MtSalesItems> selectMtSalesItemsList(MtSalesItems mtSalesItems)
    {
        return mtSalesItemsMapper.selectMtSalesItemsList(mtSalesItems);
    }

    /**
     * 新增美团门店菜品销售明细
     * 
     * @param mtSalesItems 美团门店菜品销售明细
     * @return 结果
     */
    @Override
    public int insertMtSalesItems(MtSalesItems mtSalesItems)
    {
        mtSalesItems.setCreateTime(DateUtils.getNowDate());
        return mtSalesItemsMapper.insertMtSalesItems(mtSalesItems);
    }

    /**
     * 修改美团门店菜品销售明细
     * 
     * @param mtSalesItems 美团门店菜品销售明细
     * @return 结果
     */
    @Override
    public int updateMtSalesItems(MtSalesItems mtSalesItems)
    {
        mtSalesItems.setUpdateTime(DateUtils.getNowDate());
        return mtSalesItemsMapper.updateMtSalesItems(mtSalesItems);
    }

    /**
     * 批量删除美团门店菜品销售明细
     * 
     * @param ids 需要删除的美团门店菜品销售明细ID
     * @return 结果
     */
    @Override
    public int deleteMtSalesItemsByIds(Long[] ids)
    {
        return mtSalesItemsMapper.deleteMtSalesItemsByIds(ids);
    }

    /**
     * 删除美团门店菜品销售明细信息
     * 
     * @param id 美团门店菜品销售明细ID
     * @return 结果
     */
    @Override
    public int deleteMtSalesItemsById(Long id)
    {
        return mtSalesItemsMapper.deleteMtSalesItemsById(id);
    }

    public int deleteMtSalesItemsBySaleId(Long id){
        return mtSalesItemsMapper.deleteMtSalesItemsBySalesId(id);
    }
}
